{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.Size([10, 4, 8])\n",
      "torch.Size([10, 4, 16])\n"
     ]
    }
   ],
   "source": [
    "import torch\n",
    "data = torch.zeros((10,4,2))\n",
    "pe = torch.rand((1000,1,8))\n",
    "chunk = data.chunk(data.size(-1),dim=2)\n",
    "data = torch.Tensor([])\n",
    "for i in range(len(chunk)):\n",
    "    # data.append(chunk[i]+pe[:chunk[i].size(0),...])\n",
    "    data = torch.cat((data,chunk[i]+pe[:chunk[i].size(0),...]),dim=2)\n",
    "    print(data.shape)\n",
    "# data = torch.stack(data,dim=2)\n",
    "# print(data.shape)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0      2018-01-01\n",
      "1      2018-01-02\n",
      "2      2018-01-03\n",
      "3      2018-01-04\n",
      "4      2018-01-05\n",
      "          ...    \n",
      "1518   2022-02-27\n",
      "1519   2022-02-28\n",
      "1520   2022-03-01\n",
      "1521   2022-03-02\n",
      "1522   2022-03-03\n",
      "Name: date, Length: 1523, dtype: datetime64[ns]\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd\n",
    "data = pd.read_excel('data/passengerflow.xls',parse_dates=True)\n",
    "print(data.date)\n",
    "data.columns=['date','total','one']\n",
    "print(data)\n",
    "data.to_csv('data/passengerflow.csv',index=False)\n"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "9ad32600d733b9ab35ae38f5702cf4a3d8b22bff3494f13d702dd237d877745e"
  },
  "kernelspec": {
   "display_name": "Python 3.8.12 ('pytorch_env')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.11"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
